-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup selenium testing #24
Conversation
spec/rails_helper.rb
Outdated
Capybara::Selenium::Driver.new(app, | ||
browser: :remote, | ||
capabilities:, | ||
url: "http://#{ENV['SELENIUM_HOST'] || 'selenium'}:4444/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try copying exactly what we got working in TIND-QA, which is a simplified version of what's configured for Framework. The option arguments and preferences differ a bit between the two and it's not immediately obvious what would cause a problem, so best to start with a known working config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ha! Per our discussion off-GitHub—a problem is that the Selenium container makes requests to localhost:3000, but the actual address (from its perspective) is app:3000
. IIRC from having worked with Capybara like this in the past, something in the stack (Chrome?) will complain about hitting a hostname with an invalid TLD, so you may have to use app.test:3000
with a network alias added to your compose file:
services:
app:
networks:
default:
aliases:
- app.test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also had to reconfigure shm
:
- Removed
shm_size
from the Compose file - Added the Chrome argument
--disable-dev-shm-usage
Having done both of those I'm now able to run the feature specs locally on an M-chip MacBook.
- Adds `--headless` - Removes shared-memory related settings and disables shm After doing this, I'm able to run the feature tests. Before adding the headless option I still had trouble with frequent Selenium Chrome crashes, but not since. In any case, those are "resolved" by running `docker compose restart selenium` and re-running the tests.
Migrates to a new, shared GitHub Actions workflow template provided by the BerkeleyLibrary/.github repository. This does essentially what we have always done, but pulls the workflow configuration from the central repository. The CI process is as follows: - Build: The Docker image is built, tagged (branch, SHA, and tag), and pushed to ghcr.io/berkeleylibrary/geodata. - Test: The built image is tested using `docker compose`. The test stage depends on the consuming repository having implemented `bin/test`, `bin/setup`, and `docker-compose(.ci)?.yml` files. For more information on that, see the accompanying files in this commit or the forthcoming documentation in the shared workflows repo.
v1.1.0 tags images with the literal git-tag that was pushed.
This branch is created based on omniauth upgrading branch, it only includes selenium setup codes